<!-- 页脚开始 -->
<style>
    .imgPreview {
        display: none;
        top: 0;
        left: 0;
        width: 100%; /*容器占满整个屏幕*/
        height: 100%;
        position: fixed;
        background: rgba(0, 0, 0, 0.5);
    }

    .imgPreview img {
        z-index: 50;
        width: 40%;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%,-50%);
    }
</style>
<div class="imgPreview">
    <img src="#" alt="" id="imgPreview">
</div>
<script type="text/javascript" src="/static/js/jquery.min.js"></script>
<script type="text/javascript" src="/static/js/popper.min.js"></script>
<script type="text/javascript" src="/static/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/static/js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" src="/static/js/jquery.cookie.min.js"></script>
<script type="text/javascript" src="/static/js/jquery-confirm/jquery-confirm.min.js"></script>
<script type="text/javascript" src="/static/js/main.min.js"></script>
<script type="text/javascript" src="/static/js/bootstrap-notify.min.js"></script>
<!--图标插件-->
<script type="text/javascript" src="/static/js/Chart.min.js"></script>
<!--loding插件-->
<script type="text/javascript" src="/static/js/lyear-loading.js"></script>
<!--时间日期选择器-->
<script type="text/javascript" src="/static/js/momentjs/moment.min.js"></script>
<script type="text/javascript" src="/static/js/bootstrap-datetimepicker/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="/static/js/momentjs/locale/zh-cn.min.js"></script>
<script type="text/javascript">
    //清除所有缓存
    function Clear_All(obj) {
        $.ajax({
            type:'get',
            url:"{:url('/admin/admin/clear_all')}",
            data: {},
            dataType: "json",
            success:function (data){
                $.alert({
                    title: '成功提示',
                    icon: 'mdi mdi-alert',
                    type: 'green',
                    content: data.msg
                });
            }
        })
    }
//检查更新
    function Check_Update(obj) {
        $.ajax({
            type:'get',
            url:"{:url('/admin/admin/Check_Update')}",
            data: {},
            dataType: "json",
            success:function (data){
                if (data.code == 203) { // 如果为true，则执行if语句块
                    $.alert({
                        title: '有可用更新',
                        icon: 'mdi mdi-alert',
                        type: 'red',
                        content: data.msg
                        
                    });
                    var confirm_update = document.getElementById('confirm_update');
                    confirm_update.innerText = "  立即更新";
                } else { // 否则执行else语句块
                    $.alert({
                        title: '无需更新',
                        icon: 'mdi mdi-alert',
                        type: 'green',
                        content: data.msg
                        
                    });
                }
                    
            }
        })
    }
//确认更新
    function Confirm_Update(obj) {
        $.ajax({
            type:'get',
            url:"{:url('/admin/admin/Confirm_Update')}",
            data: {},
            dataType: "json",
            success:function (data){
                if (data.code == 200) { 
                    $.confirm({
                        closeIcon: true,
                        title: '数据无价,谨慎操作',
                        content: data.msg,
                        type: 'green',
                        icon: 'mdi mdi-alert',
                        buttons: {
                            确定: function () {
                                $.alert('正在验证合法性并跳转至升级页面!');
                                location.href = "https://moran.yhdzz.cn/upgrade/index";
                            },
                            取消: function () {
                                $.alert('使用旧版后台可能导致各种未知问题!');
                            }
                        }
                    });
                } else { // 否则执行else语句块
                    $.alert({
                        title: '出现问题',
                        icon: 'mdi mdi-alert',
                        type: 'red',
                        content: data.msg
                    });
                }
                    
            }
        })
    }

//登出
    function loginout() {
        $.ajax({
            type:'get',
            url:"{:url('/admin/admin/loginout')}",
            data: {},
            dataType: "json",
            success:function (data){
                location.reload();
            }
        })
    }
        $(function () {
            $('.imgurl').on('click', function () {
                var src = $(this).attr('src');
                $('.imgPreview img').attr('src', src);
                $('.imgPreview').show()
            });
            
            $('.imgPreview').on('click', function () {$('.imgPreview').hide()});
    })
</script>
<!-- 页脚结束 -->